import { param2Obj } from 'utils';

const schoolTreeData =  [
  {
    "id": 13,
    "parentId": -1,
    "children": [
      {
        "id": 5,
        "parentId": 13,
        "children": [

        ],
        "icon": "setting",
        "title": "马鞍山一中",
        "href": "/admin",
        "spread": false,
        "path": "/adminSys/baseManager",
        "code": "baseManager",
        "label": "马鞍山一中"
      },
      {
        "id": 29,
        "parentId": 13,
        "children": [

        ],
        "icon": "service",
        "title": "马鞍山二中",
        "href": "/auth",
        "spread": false,
        "path": "/adminSys/authManager",
        "code": "authManager",
        "label": "马鞍山二中"
      },
      {
        "id": 31,
        "parentId": 13,
        "children": [

        ],
        "icon": "service",
        "title": "马鞍山三中",
        "spread": false,
        "path": "/adminSys/monitorManager",
        "code": "monitorManager",
        "label": "马鞍山三中"
      },
      {
        "id": 38,
        "parentId": 13,
        "children": [

        ],
        "icon": "setting",
        "title": "马鞍山四中",
        "spread": false,
        "path": "/adminSys/schoolManager",
        "code": "schoolManager",
        "label": "马鞍山四中"
      },
      {
        "id": 40,
        "parentId": 13,
        "children": [

        ],
        "icon": "setting",
        "title": "马鞍山市第八中学",
        "spread": false,
        "path": "/adminSys/personManager",
        "code": "personManager",
        "label": "马鞍山市第八中学"
      }
    ],
    "icon": "setting",
    "title": "马鞍山市",
    "href": "/base",
    "spread": false,
    "path": "/adminSys",
    "code": "adminSys",
    "label": "马鞍山市"
  }
];

export default {
  getSchoolTree: config => {
    return schoolTreeData;
  },
  getInfo: config => {
    const { token } = param2Obj(config.url);
    if (userMap[token]) {
      return userMap[token];
    } else {
      return Promise.reject('a');
    }
  },
  logout: () => 'success'
};
